package com.ke.jun.view.widght

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.util.AttributeSet
import android.view.View

class MyPathVeiw @JvmOverloads constructor(context: Context,attributeSet: AttributeSet?=null,defStyleAttr: Int=0):
    View(context,attributeSet,defStyleAttr) {
    private  val paint=Paint()
    private val path=Path()
    init {
          with(paint){
              color=Color.BLACK
              strokeWidth=10f
              style=Paint.Style.FILL
              isAntiAlias=true
          }
        with(path){
            addArc(200f,200f,400f,400f,-225f,225f)
            arcTo(400f,200f,600f,400f,-180f,225f,false)
            lineTo(400f,542f)
        }
    }

    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
        canvas.drawPath(path,paint)
    }


}